:root {
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: #f5f5f5;
  color: #333;
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
}

#root {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem;
  box-sizing: border-box;
}

.calendar-container {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  box-sizing: border-box;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.calendar-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.date-selectors {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.date-selector {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 80px;
}

.date-selector label {
  font-size: 0.75rem;
  color: #666;
  font-weight: 500;
  text-align: center;
}

.date-selector select {
  padding: 0.4rem 0.3rem;
  border: 2px solid #e1e5e9;
  border-radius: 6px;
  font-size: 0.875rem;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
  width: 100%;
  text-align: center;
}

.date-selector select:hover {
  border-color: #646cff;
}

.date-selector select:focus {
  outline: none;
  border-color: #646cff;
  box-shadow: 0 0 0 3px rgba(100, 108, 255, 0.1);
}

/* React Calendar 自定义样式 */
.react-calendar {
  width: 100%;
  max-width: 100%;
  background: white;
  border: none;
  font-family: inherit;
  line-height: 1.125em;
}

/* 班次信息样式 */
.shift-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-top: 2px;
  width: 100%;
}

.shift-badge {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 8px;
  color: white;
  font-weight: bold;
  min-width: 28px;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

.shift-badge.night {
  background-color: #4c51bf !important;
}

.shift-badge.day {
  background-color: #d69e2e !important;
}

.shift-badge.rest {
  background-color: #38a169 !important;
}

.shift-time {
  font-size: 8px;
  color: #666;
  text-align: center;
  line-height: 1.2;
}

.today-marker {
  font-size: 8px;
  color: #e53e3e;
  font-weight: bold;
}

.selected-shift-info {
  background: #f7fafc;
  padding: 10px;
  border-radius: 6px;
  margin-top: 8px;
  border-left: 4px solid #646cff;
}

.selected-shift-info p {
  margin: 4px 0;
  display: flex;
  align-items: center;
}

/* 排班说明样式 */
.shift-legend {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
  margin-top: 16px;
  border: 1px solid #e1e5e9;
}

.shift-legend h3 {
  margin: 0 0 12px 0;
  color: #333;
  font-size: 16px;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-item span:last-child {
  color: #666;
  font-size: 14px;
}

.shift-cycle {
  margin: 8px 0 0 0;
  color: #666;
  font-size: 13px;
  font-style: italic;
}

.react-calendar--doubleView {
  width: 700px;
}

.react-calendar--doubleView .react-calendar__viewContainer {
  display: flex;
  margin: -0.5em;
}

.react-calendar--doubleView .react-calendar__viewContainer > * {
  width: 50%;
  margin: 0.5em;
}

.react-calendar *,
.react-calendar *:before,
.react-calendar *:after {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

.react-calendar button {
  margin: 0;
  border: 0;
  outline: none;
}

.react-calendar button:enabled:hover,
.react-calendar button:enabled:focus {
  background-color: #e6f3ff;
}

.react-calendar__navigation {
  display: flex;
  height: 44px;
  margin-bottom: 1em;
}

.react-calendar__navigation button {
  min-width: 44px;
  background: none;
  font-size: 16px;
  font-weight: bold;
  color: #646cff;
}

.react-calendar__navigation button:disabled {
  background-color: #f0f0f0;
  color: #999;
}

.react-calendar__navigation button:enabled:hover,
.react-calendar__navigation button:enabled:focus {
  background-color: #e6f3ff;
}

.react-calendar__month-view__weekdays {
  text-align: center;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 0.75em;
  color: #666;
}

.react-calendar__month-view__weekdays__weekday {
  padding: 0.5em;
}

.react-calendar__month-view__weekNumbers .react-calendar__tile {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  font-weight: bold;
  color: #666;
}

.react-calendar__month-view__days__day--weekend {
  color: #d10000;
}

.react-calendar__month-view__days__day--neighboringMonth {
  color: #757575;
}

.react-calendar__year-view .react-calendar__tile,
.react-calendar__decade-view .react-calendar__tile,
.react-calendar__century-view .react-calendar__tile {
  padding: 2em 0.5em;
}

.react-calendar__tile {
  max-width: 100%;
  padding: 6px 3px;
  background: none;
  text-align: center;
  line-height: 14px;
  font-size: 13px;
  color: #333;
  border-radius: 6px;
  transition: all 0.2s;
  min-height: 75px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.react-calendar__tile:disabled {
  background-color: #f0f0f0;
  color: #999;
}

.react-calendar__tile:enabled:hover,
.react-calendar__tile:enabled:focus {
  background-color: #e6f3ff;
  color: #646cff;
}

.react-calendar__tile--now {
  background: #646cff;
  color: white;
  font-weight: bold;
}

.react-calendar__tile--now:enabled:hover,
.react-calendar__tile--now:enabled:focus {
  background: #5a5fcf;
}

.react-calendar__tile--hasActive {
  background: #76baff;
}

.react-calendar__tile--hasActive:enabled:hover,
.react-calendar__tile--hasActive:enabled:focus {
  background: #a9d4ff;
}

.react-calendar__tile--active {
  background: #bed0e3;
  color: white;
}

.react-calendar__tile--active:enabled:hover,
.react-calendar__tile--active:enabled:focus {
  background: #1087ff;
}

@media (max-width: 768px) {
  #root {
    padding: 0.5rem;
  }
  
  .calendar-container {
    padding: 1rem;
    margin: 0;
    border-radius: 8px;
  }
  
  .calendar-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    margin-bottom: 1rem;
  }
  
  .calendar-title {
    font-size: 1.25rem;
    min-width: auto;
  }
  
  .date-selectors {
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
  }
  
  .date-selector {
    min-width: 70px;
  }
  
  .date-selector select {
    font-size: 0.75rem;
    padding: 0.3rem 0.2rem;
  }
  
  .react-calendar {
    font-size: 11px;
  }
  
  .react-calendar__navigation {
    height: 36px;
    margin-bottom: 0.5em;
  }
  
  .react-calendar__navigation button {
    min-width: 36px;
    font-size: 14px;
  }
  
  .react-calendar__month-view__weekdays {
    font-size: 0.65em;
  }
  
  .react-calendar__month-view__weekdays__weekday {
    padding: 0.3em;
  }
  
  .react-calendar__tile {
    padding: 4px 2px;
    min-height: 65px;
    font-size: 11px;
    line-height: 12px;
  }
  
  .shift-badge {
    font-size: 7px;
    padding: 1px 3px;
    min-width: 22px;
    border-radius: 6px;
  }
  
  .shift-time {
    font-size: 6px;
  }
  
  .today-marker {
    font-size: 6px;
  }
  
  .selected-shift-info {
    padding: 8px;
    margin-top: 0.5rem;
    font-size: 13px;
  }
  
  .selected-shift-info p {
    margin: 3px 0;
    font-size: 13px;
  }
  
  .selected-shift-info .shift-badge {
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 6px;
  }
  
  .shift-legend {
    padding: 10px;
    margin-top: 12px;
  }
  
  .shift-legend h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .legend-items {
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
  }
  
  .legend-item {
    gap: 6px;
    align-items: center;
    justify-content: flex-start;
  }
  
  .legend-item span:last-child {
    font-size: 12px;
  }
  
  .legend-item .shift-badge {
    font-size: 8px;
    padding: 2px 5px;
    min-width: 26px;
  }
  
  .shift-cycle {
    font-size: 11px;
    margin-top: 6px;
  }
}

/* 针对小屏手机的额外优化 */
@media (max-width: 480px) {
  .calendar-container {
    padding: 0.75rem;
  }
  
  .calendar-title {
    font-size: 1.1rem;
  }
  
  .date-selector {
    min-width: 65px;
  }
  
  .react-calendar__tile {
    min-height: 55px;
    padding: 3px 1px;
  }
  
  .shift-badge {
    font-size: 6px;
    padding: 1px 2px;
    min-width: 20px;
  }
  
  .selected-shift-info {
    font-size: 12px;
  }
  
  .legend-item span:last-child {
    font-size: 11px;
  }
}
